import React from 'react';
import { Icon, Form, Input, Button } from 'antd';

const FormItem = Form.Item;

/**
 * Header 修改信息 form
 */
class UpdateUserInfoForm extends React.Component {

  render() {
   const formItemLayout = {
      labelCol: {
        xs: { span: 12 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
    };
    const { getFieldDecorator } = this.props.form;
    let nick=this.props.nick;
    return (
          <Form method="post" className="login-form">
            <FormItem 
              {...formItemLayout}
              label="昵称"
            >
              {getFieldDecorator('nick', {
                rules: [
                         { required: true, message: '昵称不能为空' },
                         { max: 10, message: '昵称不能超过10位' }
                      ],
                initialValue:nick
              })(
                <Input placeholder="请输入昵称，不超过10位" />
                )}
            </FormItem>
          </Form>
    );
  }
}

UpdateUserInfoForm = Form.create({})(UpdateUserInfoForm);

export default UpdateUserInfoForm;